package myclient;

import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JLabel;
import javax.swing.JOptionPane;
/**
 * @author JIAO
 */
public class SettingListener implements MouseListener{
	JLabel lb_set = null;
	JLabel lb_find = null;
	MainFrame mainFm = null;
	SearchFrame search = null;
//	private ImageIcon setEnter;
//	private ImageIcon setExit;
//	private ImageIcon findEnter;
//	private ImageIcon findExit;
	SettingListener(JLabel lb_set,JLabel lb_find,MainFrame mainFm){
		this.lb_set = lb_set;
		this.lb_find = lb_find;
		this.mainFm = mainFm;
//		ImageFactory factory = new ImageFactory();
//		setEnter = factory.make("/image/set2.gif");
//		setExit = factory.make("/image/set1.gif");
//		findEnter = factory.make("/image/find1.gif");
//		findExit = factory.make("/image/find2.gif");
	}
	public void mouseClicked(MouseEvent e) {
//		JOptionPane.showMessageDialog(null, e.getComponent().getName());
		if(e.getComponent().getName().equals("search")){
			search = new SearchFrame(mainFm.conn.writer,mainFm);
		}else if(e.getComponent().getName().equals("set")){
			new PersonalSettingFrame(mainFm);
		}
	}
	public void mouseEntered(MouseEvent e) {
//		if(e.getComponent().getName().equals("search")){
//			lb_find.setIcon(findEnter);
//		}else if(e.getComponent().getName().equals("set")){
//			lb_set.setIcon(setEnter);
//		}
	}
	public void mouseExited(MouseEvent e) {
//		if(e.getComponent().getName().equals("search")){
//			lb_find.setIcon(findExit);
//		}else if(e.getComponent().getName().equals("set")){
//			lb_set.setIcon(setExit);
//		}
	}
	public void mousePressed(MouseEvent e) {
	}
	public void mouseReleased(MouseEvent e) {
	}
}
